﻿using BonjourQuotation.DataAccess.Repositories;
using BonjourQuotation.ObjectModel.AccountData;
using BonjourQuotation.ObjectModel.ErrorData;
using BonjourQuotation.ObjectModel.ReportData;
using BonjourQuotation.ObjectModel.LoggerData;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BonjourQuotation.UI.ServiceManagers
{
    public class ReportManager
    {
        private readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        public RoomingListReportBData RoomingListReport(int GroupID, int VendorID, DateTime ArrivalDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.RoomingListReport(GroupID, VendorID, ArrivalDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public RoomingListReportBData MasterRoomingListReport(int GroupID)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.MasterRoomingListReport(GroupID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public TechProgReportBData TechProgReport(int GroupID)
        {
            var proxy = new ReportRepository();
            return proxy.TechProgReport(GroupID);
        }
        public GVendorListReportBData GroupVendorListReport(int GroupID)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GroupVendorListReport(GroupID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public GroupInvoiceReportBData GroupInvoiceReport(int GroupID)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GroupInvoiceReport(GroupID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public GroupInvoiceReportBData GirGroupInvoiceReport(int GroupID, int CustomerID)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GirGroupInvoiceReport(GroupID, CustomerID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public CustomerInvoiceReportBData CustomerInvoiceReport(int CustomerID, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.CustomerInvoiceReport(CustomerID, StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public FrmCustomerGroupRevenueReportBData LoadFrmCountryCustomerGroupRevenueReport()
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.LoadFrmCountryCustomerGroupRevenueReport();
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public CountryCustomerGroupRevenueReportBData CountryCustomerGroupRevenueReport(int NationalityID, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.CountryCustomerGroupRevenueReport(NationalityID, StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public CustomerPaymentReportBData CustomerPaymentReport(int CustomerID, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.CustomerPaymentReport(CustomerID, StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public CustomerGroupReportBData CustomerGroupReport(int CustomerID, DateTime StartDate, DateTime EndDate, bool? IsGir)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.CustomerGroupReport(CustomerID, StartDate, EndDate, IsGir);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public VendorGroupReportBData VendorGroupReport(int VendorID, DateTime Lower, DateTime Upper, string TabName, List<int> StatusIDs, string City, bool? IsPlane, string Category, string CityDrop, bool? IsGir)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.VendorGroupReport(VendorID, Lower, Upper, TabName, StatusIDs, City, IsPlane, Category, CityDrop, IsGir);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public GuideGroupReportBData GuideGroupReport(int GuideID, DateTime Lower, DateTime Upper, bool? IsGir)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GuideGroupReport(GuideID, Lower, Upper, IsGir);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public GroupGuideReportBData GroupGuideReport(DateTime Lower, DateTime Upper, bool? IsGir)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GroupGuideReport(Lower, Upper, IsGir);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public FrmCustomerGroupBalanceReportBData LoadFrmCountryCustomerGroupBalanceReport()
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.LoadFrmCountryCustomerGroupBalanceReport();
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public FrmVendorGroupReportBData LoadFrmVCnfStatus()
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.LoadFrmVCnfStatus();
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
        public CountryCustomerGroupBalanceReportBData CountryCustomerGroupBalanceReport(int NationalityID, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.CountryCustomerGroupBalanceReport(NationalityID, StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public GroupRegionRoomDayReportBData GroupRegionRoomDayReport(DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GroupRegionRoomDayReport(StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public GroupCityRoomDayReportBData GroupCityRoomDayReport(DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GroupCityRoomDayReport(StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public CustomerARDayesReportBData CustomerARDayesReport(int CustomerID, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.CustomerARDayesReport(CustomerID, StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public FrmCustomerPaymentTypeReportBData LoadFrmCustomerPaymentTypeReport()
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.LoadFrmCustomerPaymentTypeReport();
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public CustomerPaymentTypeReportBData CustomerPaymentTypeReport(int PaymentTypeID, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.CustomerPaymentTypeReport(PaymentTypeID, StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public CustomerRefundReportBData CustomerRefundReport(int CustomerID, DateTime StartDate, DateTime EndDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.CustomerRefundReport(CustomerID, StartDate, EndDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public FrmGuideListReportBData LoadFrmGuideListReport()
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.LoadFrmGuideListReport();
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public GuideListReportBData GuideListReport(int RegionID)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GuideListReport(RegionID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public FrmHotelContractsReportBData LoadFrmHotelContractsReport()
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.LoadFrmHotelContractsReport();
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public HotelContractsReportBData HotelContractsReport(int RegionID, int SeasonID)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.HotelContractsReport(RegionID, SeasonID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public VConfirmBreakDownReportBData VConfirmBreakDownReport(int VendorID, int GroupID, DateTime ArrivalDate)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.VConfirmBreakDownReport(VendorID, GroupID, ArrivalDate);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public OperationAmexVendorReportBData AuthorizationFormReport(int AuthFormID)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.AuthorizationFormReport(AuthFormID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public Dictionary<int, string> FindKeywordInEntity(string PropName, string keyword, string TabName)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.FindKeywordInEntity(PropName, keyword, TabName);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
        public GroupBreakDownReportBData GroupBreakDownReport(DateTime StartDate, DateTime EndDate, bool? IsGir)
        {
            try
            {
                var proxy = new ReportRepository();
                return proxy.GroupBreakDownReport(StartDate, EndDate, IsGir);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
    }
}